home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: Mailbox/MIME Entity
(archive/mbox).
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| Mailbox/MIME Entity (archive/mbox)
| magic
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| C source text
| default
| |
99%
| file
| C source, ISO-8859 text
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| fmt/950 MIME Email (1.0)
| default
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 4e 65 77 73 67 72 6f 75 | 70 73 3a 20 63 6f 6d 70 |Newsgrou|ps: comp|
|00000010| 2e 6c 61 6e 67 2e 63 2b | 2b 0a 50 61 74 68 3a 20 |.lang.c+|+.Path: |
|00000020| 61 72 74 65 6d 69 73 2e | 73 74 6f 2e 66 64 61 74 |artemis.|sto.fdat|
|00000030| 61 2e 73 65 21 6e 65 77 | 73 0a 46 72 6f 6d 3a 20 |a.se!new|s.From: |
|00000040| 4e 69 6b 6c 61 73 20 4d | 65 6c 6c 69 6e 20 3c 6e |Niklas M|ellin <n|
|00000050| 69 6b 6c 61 73 2e 6d 65 | 6c 6c 69 6e 40 73 74 6f |iklas.me|llin@sto|
|00000060| 2e 66 64 61 74 61 2e 73 | 65 3e 0a 53 75 62 6a 65 |.fdata.s|e>.Subje|
|00000070| 63 74 3a 20 52 65 3a 20 | 45 72 72 6f 72 3f 0a 53 |ct: Re: |Error?.S|
|00000080| 65 6e 64 65 72 3a 20 6e | 65 77 73 40 61 72 74 65 |ender: n|ews@arte|
|00000090| 6d 69 73 2e 73 74 6f 2e | 66 64 61 74 61 2e 73 65 |mis.sto.|fdata.se|
|000000a0| 20 28 55 73 65 4e 65 74 | 20 4e 65 74 4e 65 77 73 | (UseNet| NetNews|
|000000b0| 29 0a 4d 65 73 73 61 67 | 65 2d 49 44 3a 20 3c 33 |).Messag|e-ID: <3|
|000000c0| 30 46 30 45 31 45 34 2e | 35 43 31 37 40 73 74 6f |0F0E1E4.|5C17@sto|
|000000d0| 2e 66 64 61 74 61 2e 73 | 65 3e 0a 44 61 74 65 3a |.fdata.s|e>.Date:|
|000000e0| 20 4d 6f 6e 2c 20 38 20 | 4a 61 6e 20 31 39 39 36 | Mon, 8 |Jan 1996|
|000000f0| 20 30 39 3a 32 30 3a 33 | 36 20 47 4d 54 0a 54 6f | 09:20:3|6 GMT.To|
|00000100| 3a 20 4c 61 72 73 20 4b | 61 64 65 72 61 6c 69 20 |: Lars K|aderali |
|00000110| 3c 61 32 38 36 37 30 30 | 31 40 73 6d 61 69 6c 2e |<a286700|1@smail.|
|00000120| 72 72 7a 2e 55 6e 69 2d | 4b 6f 65 6c 6e 2e 44 45 |rrz.Uni-|Koeln.DE|
|00000130| 3e 0a 43 6f 6e 74 65 6e | 74 2d 54 72 61 6e 73 66 |>.Conten|t-Transf|
|00000140| 65 72 2d 45 6e 63 6f 64 | 69 6e 67 3a 20 37 62 69 |er-Encod|ing: 7bi|
|00000150| 74 0a 43 6f 6e 74 65 6e | 74 2d 54 79 70 65 3a 20 |t.Conten|t-Type: |
|00000160| 74 65 78 74 2f 70 6c 61 | 69 6e 3b 20 63 68 61 72 |text/pla|in; char|
|00000170| 73 65 74 3d 75 73 2d 61 | 73 63 69 69 0a 52 65 66 |set=us-a|scii.Ref|
|00000180| 65 72 65 6e 63 65 73 3a | 20 3c 34 63 70 61 6f 76 |erences:| <4cpaov|
|00000190| 24 32 34 31 40 6e 65 77 | 73 2e 72 72 7a 2e 75 6e |$241@new|s.rrz.un|
|000001a0| 69 2d 6b 6f 65 6c 6e 2e | 64 65 3e 0a 4d 69 6d 65 |i-koeln.|de>.Mime|
|000001b0| 2d 56 65 72 73 69 6f 6e | 3a 20 31 2e 30 0a 58 2d |-Version|: 1.0.X-|
|000001c0| 4d 61 69 6c 65 72 3a 20 | 4d 6f 7a 69 6c 6c 61 20 |Mailer: |Mozilla |
|000001d0| 32 2e 30 62 34 20 28 57 | 69 6e 4e 54 3b 20 49 29 |2.0b4 (W|inNT; I)|
|000001e0| 0a 4f 72 67 61 6e 69 7a | 61 74 69 6f 6e 3a 20 57 |.Organiz|ation: W|
|000001f0| 4d 2d 64 61 74 61 20 46 | f6 72 73 76 61 72 73 64 |M-data F|.rsvarsd|
|00000200| 61 74 61 20 41 42 2c 20 | 53 77 65 64 65 6e 0a 0a |ata AB, |Sweden..|
|00000210| 4c 61 72 73 20 4b 61 64 | 65 72 61 6c 69 20 77 72 |Lars Kad|erali wr|
|00000220| 6f 74 65 3a 0a 5b 2e 2e | 2e 5d 0a 3e 20 0a 3e 20 |ote:.[..|.].> .> |
|00000230| 2f 2f 74 65 73 74 0a 3e | 20 23 69 6e 63 6c 75 64 |//test.>| #includ|
|00000240| 65 20 3c 69 6f 73 74 72 | 65 61 6d 2e 68 3e 0a 3e |e <iostr|eam.h>.>|
|00000250| 20 66 6c 6f 61 74 20 61 | 2c 62 3b 0a 3e 20 6d 61 | float a|,b;.> ma|
|00000260| 69 6e 28 29 0a 3e 20 7b | 0a 3e 20 20 20 61 3d 2d |in().> {|.> a=-|
|00000270| 31 2e 30 3b 20 62 3d 30 | 2e 31 3b 0a 3e 20 20 20 |1.0; b=0|.1;.> |
|00000280| 77 68 69 6c 65 20 28 61 | 3c 31 2e 31 29 0a 3e 20 |while (a|<1.1).> |
|00000290| 20 20 7b 0a 3e 20 20 20 | 20 20 63 6f 75 74 3c 3c | {.> | cout<<|
|000002a0| 61 3c 3c 65 6e 64 6c 3b | 0a 3e 20 20 20 20 20 61 |a<<endl;|.> a|
|000002b0| 2b 3d 62 3b 0a 3e 20 20 | 20 7d 0a 3e 20 7d 0a 3e |+=b;.> | }.> }.>|
|000002c0| 20 0a 3e 20 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d | .> ====|========|
|000002d0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|000002e0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 0a 3e 20 0a 3e |========|===.> .>|
|000002f0| 20 77 68 69 63 68 20 72 | 65 74 75 72 6e 73 3a 0a | which r|eturns:.|
|00000300| 0a 5b 2e 2e 2e 5d 0a 0a | 3e 20 37 2e 34 35 30 35 |.[...]..|> 7.4505|
|00000310| 38 31 65 2d 30 38 20 20 | 20 20 20 3c 20 3d 3d 3d |81e-08 | < ===|
|00000320| 3d 20 3f 3f 3f 3f 3f 3f | 3f 3f 3f 3f 3f 3f 3f 3f |= ??????|????????|
|00000330| 0a 0a 5b 2e 2e 2e 5d 0a | 0a 3e 20 48 6f 77 20 63 |..[...].|.> How c|
|00000340| 6f 6d 65 20 74 68 69 73 | 20 37 2e 34 35 30 35 38 |ome this| 7.45058|
|00000350| 31 65 2d 30 38 20 68 61 | 70 70 65 6e 73 20 69 6e |1e-08 ha|ppens in|
|00000360| 73 74 65 61 64 20 6f 66 | 20 30 2e 30 20 3f 3f 3f |stead of| 0.0 ???|
|00000370| 3f 3f 0a 3e 20 50 6c 65 | 61 73 65 20 72 65 70 6c |??.> Ple|ase repl|
|00000380| 79 20 64 69 72 65 63 74 | 6c 79 20 76 69 61 20 65 |y direct|ly via e|
|00000390| 2d 6d 61 69 6c 20 69 66 | 20 79 6f 75 20 6b 6e 6f |-mail if| you kno|
|000003a0| 77 20 74 6f 20 68 65 6c | 70 21 21 21 0a 3e 20 54 |w to hel|p!!!.> T|
|000003b0| 68 61 6e 78 20 61 20 6c | 6f 74 21 0a 3e 20 0a 3e |hanx a l|ot!.> .>|
|000003c0| 20 4c 61 72 73 0a 0a 37 | 2e 34 35 30 35 38 30 65 | Lars..7|.450580e|
|000003d0| 2d 30 38 20 69 73 20 74 | 68 65 20 73 63 69 65 6e |-08 is t|he scien|
|000003e0| 74 69 66 69 63 20 6e 6f | 74 61 74 69 6f 6e 20 66 |tific no|tation f|
|000003f0| 6f 72 20 30 2e 30 30 30 | 30 30 30 37 34 35 30 35 |or 0.000|00074505|
|00000400| 38 2e 0a 54 68 65 20 72 | 65 61 73 6f 6e 20 79 6f |8..The r|eason yo|
|00000410| 75 20 67 65 74 20 74 68 | 69 73 20 61 6e 73 77 65 |u get th|is answe|
|00000420| 72 20 69 73 20 74 68 61 | 74 20 74 68 65 20 62 69 |r is tha|t the bi|
|00000430| 6e 61 72 79 20 66 6f 72 | 6d 61 74 0a 6f 66 20 66 |nary for|mat.of f|
|00000440| 6c 6f 61 74 69 6e 67 20 | 70 6f 69 6e 74 20 6e 75 |loating |point nu|
|00000450| 6d 62 65 72 73 20 63 61 | 6e 6e 6f 74 20 62 65 20 |mbers ca|nnot be |
|00000460| 65 78 61 63 74 2e 20 42 | 75 74 20 74 68 61 74 20 |exact. B|ut that |
|00000470| 69 73 20 75 73 75 61 6c | 6c 79 0a 6e 6f 74 20 61 |is usual|ly.not a|
|00000480| 20 62 69 67 20 70 72 6f | 62 6c 65 6d 20 65 78 63 | big pro|blem exc|
|00000490| 65 70 74 20 69 6e 20 73 | 6f 6d 65 20 6e 75 6d 65 |ept in s|ome nume|
|000004a0| 72 69 63 61 6c 20 61 70 | 70 6c 69 63 61 74 69 6f |rical ap|plicatio|
|000004b0| 6e 73 20 77 68 65 72 65 | 0a 61 20 6c 6f 74 20 6f |ns where|.a lot o|
|000004c0| 66 20 73 6d 61 6c 6c 20 | 72 6f 75 6e 64 69 6e 67 |f small |rounding|
|000004d0| 20 65 72 72 6f 72 73 20 | 74 6f 67 65 74 68 65 72 | errors |together|
|000004e0| 20 6c 65 61 64 73 20 74 | 6f 20 61 20 6c 61 72 67 | leads t|o a larg|
|000004f0| 65 20 65 72 72 6f 72 0a | 69 6e 20 74 68 65 20 66 |e error.|in the f|
|00000500| 69 6e 61 6c 20 72 65 73 | 75 6c 74 2e 0a 0a 59 6f |inal res|ult...Yo|
|00000510| 75 72 20 70 72 6f 62 6c | 65 6d 20 69 73 20 74 6f |ur probl|em is to|
|00000520| 20 66 69 78 20 79 6f 75 | 72 20 70 72 6f 67 72 61 | fix you|r progra|
|00000530| 6d 20 73 6f 20 69 74 20 | 6f 6e 6c 79 20 73 68 6f |m so it |only sho|
|00000540| 77 73 20 6f 6e 65 20 64 | 65 63 69 6d 61 6c 0a 69 |ws one d|ecimal.i|
|00000550| 6e 20 74 68 65 20 6f 75 | 74 70 75 74 2e 20 54 68 |n the ou|tput. Th|
|00000560| 65 20 66 6f 6c 6c 6f 77 | 69 6e 67 20 70 72 6f 67 |e follow|ing prog|
|00000570| 72 61 6d 20 69 73 20 63 | 68 61 6e 67 65 64 20 74 |ram is c|hanged t|
|00000580| 6f 20 64 6f 20 74 68 61 | 74 2e 20 49 0a 61 6c 73 |o do tha|t. I.als|
|00000590| 6f 20 70 75 74 20 69 6e | 20 61 20 77 69 64 74 68 |o put in| a width|
|000005a0| 20 73 70 65 63 69 66 69 | 65 72 20 73 6f 20 79 6f | specifi|er so yo|
|000005b0| 75 20 67 65 74 20 74 68 | 65 20 64 65 63 69 6d 61 |u get th|e decima|
|000005c0| 6c 20 70 6f 69 6e 74 20 | 69 6e 0a 74 68 65 20 73 |l point |in.the s|
|000005d0| 61 6d 65 20 63 6f 6c 75 | 6d 6e 2e 0a 0a 23 69 6e |ame colu|mn...#in|
|000005e0| 63 6c 75 64 65 20 3c 69 | 6f 73 74 72 65 61 6d 2e |clude <i|ostream.|
|000005f0| 68 3e 0a 23 69 6e 63 6c | 75 64 65 20 3c 69 6f 6d |h>.#incl|ude <iom|
|00000600| 61 6e 69 70 2e 68 3e 0a | 0a 6d 61 69 6e 28 29 0a |anip.h>.|.main().|
|00000610| 7b 0a 20 20 66 6c 6f 61 | 74 20 61 20 3d 20 2d 31 |{. floa|t a = -1|
|00000620| 3b 0a 20 20 66 6c 6f 61 | 74 20 62 20 3d 20 30 2e |;. floa|t b = 0.|
|00000630| 31 3b 0a 0a 20 20 63 6f | 75 74 2e 73 65 74 66 28 |1;.. co|ut.setf(|
|00000640| 69 6f 73 3a 3a 66 69 78 | 65 64 29 3b 0a 20 20 63 |ios::fix|ed);. c|
|00000650| 6f 75 74 2e 70 72 65 63 | 69 73 69 6f 6e 28 31 29 |out.prec|ision(1)|
|00000660| 3b 0a 20 20 77 68 69 6c | 65 20 28 61 20 3c 20 31 |;. whil|e (a < 1|
|00000670| 2e 31 29 0a 20 20 7b 0a | 09 20 63 6f 75 74 20 3c |.1). {.|. cout <|
|00000680| 3c 20 73 65 74 77 28 34 | 29 20 3c 3c 20 61 20 3c |< setw(4|) << a <|
|00000690| 3c 20 65 6e 64 6c 3b 0a | 09 20 61 20 2b 3d 20 62 |< endl;.|. a += b|
|000006a0| 3b 0a 20 20 7d 0a 7d 0a | 0a 69 6f 6d 61 6e 69 70 |;. }.}.|.iomanip|
|000006b0| 2e 68 20 69 73 20 6e 65 | 65 64 65 64 20 66 6f 72 |.h is ne|eded for|
|000006c0| 20 74 68 65 20 73 65 74 | 77 28 29 20 6d 61 6e 69 | the set|w() mani|
|000006d0| 70 75 6c 61 74 6f 72 2e | 20 41 6e 6f 74 68 65 72 |pulator.| Another|
|000006e0| 20 63 68 61 6e 67 65 0a | 79 6f 75 20 63 61 6e 20 | change.|you can |
|000006f0| 63 6f 6e 73 69 64 65 72 | 20 69 73 20 74 6f 20 63 |consider| is to c|
|00000700| 68 61 6e 67 65 20 74 68 | 65 20 66 6c 6f 61 74 20 |hange th|e float |
|00000710| 74 6f 20 64 6f 75 62 6c | 65 2c 20 74 68 65 6e 20 |to doubl|e, then |
|00000720| 79 6f 75 0a 77 69 6c 6c | 20 70 72 6f 62 61 62 6c |you.will| probabl|
|00000730| 79 20 67 65 74 20 62 65 | 74 74 65 72 20 70 72 65 |y get be|tter pre|
|00000740| 63 69 73 69 6f 6e 20 69 | 6e 20 79 6f 75 72 20 66 |cision i|n your f|
|00000750| 6c 6f 61 74 69 6e 67 20 | 70 6f 69 6e 74 0a 63 61 |loating |point.ca|
|00000760| 6c 63 75 6c 61 74 69 6f | 6e 73 2e 20 4f 6e 20 6d |lculatio|ns. On m|
|00000770| 79 20 73 79 73 74 65 6d | 20 74 68 65 20 6f 75 74 |y system| the out|
|00000780| 70 75 74 20 63 68 61 6e | 67 65 64 20 66 72 6f 6d |put chan|ged from|
|00000790| 20 65 2d 38 20 74 6f 20 | 65 2d 31 36 2e 0a 54 68 | e-8 to |e-16..Th|
|000007a0| 65 20 63 6f 73 74 20 69 | 73 20 6d 65 6d 6f 72 79 |e cost i|s memory|
|000007b0| 2c 20 6f 6e 20 6d 79 20 | 73 79 73 74 65 6d 20 61 |, on my |system a|
|000007c0| 20 66 6c 6f 61 74 20 69 | 73 20 34 20 62 79 74 65 | float i|s 4 byte|
|000007d0| 73 2c 20 61 6e 64 20 61 | 0a 64 6f 75 62 6c 65 20 |s, and a|.double |
|000007e0| 38 20 62 79 74 65 73 2e | 0a 0a 2d 2d 2d 0a 4e 69 |8 bytes.|..---.Ni|
|000007f0| 6b 6c 61 73 20 4d 65 6c | 6c 69 6e 0a |klas Mel|lin. |
+--------+-------------------------+-------------------------+--------+--------+